//
//  GDTSplashAdvertisementView.m
//  SEGUhomeChassis
//
//  Created by 山刘 on 2019/12/10.
//  Copyright © 2019 山刘. All rights reserved.
//

#import "GDTSplashAdvertisementView.h"

@implementation GDTSplashAdvertisementView
-(instancetype)initWithFrame:(CGRect)frame{
    if (self == [super initWithFrame:frame]) {
        self.backgroundColor = kColor_W;
        [self initSubViews];
    }
    return self;
}

-(void)initSubViews {
    UIImageView* imageView = [[UIImageView alloc] init];
    imageView.image = [UIImage imageWithContentsOfFile:SEGPicName(@"AppIcon60_corner")];
    [self addSubview:imageView];
    
    UILabel *appNameLabel = ({
        UILabel *label = [[UILabel alloc] init];
        [self addSubview:label];
        label.textColor = kColor_1;
        label.font = [[UIFont systemFontOfSize:20.0] fontWithBold];
        label.text = kAppName;
        label;
    });
    
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(25);
        make.centerY.equalTo(self);
        make.left.equalTo(self).mas_offset(132.F);
    }];
    
    [appNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(imageView.mas_right).mas_offset(7.F);
        make.centerY.equalTo(imageView);
    }];
}
@end
